package com.ed100.sass.patter.flyweight;

import java.util.HashMap;
import java.util.Map;

public class ConcreteCompositeFlyweight implements FlyWeight {

	private Map<Character, FlyWeight> flys = new HashMap<Character, FlyWeight>();

	public void add(Character key, FlyWeight fly) {
		flys.put(key, fly);
	}

	@Override
	public void operation(String state) {
		FlyWeight fly = null;
		for (Object o : flys.keySet()) {

			fly = flys.get(o);
			fly.operation(state);
		}
	}

}
